package com.lh.controller;


import com.lh.commonutils.R;
import com.lh.service.IStatisticsDailyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author lh
 * @since 2021-06-09
 */
@RestController
@RequestMapping("/edusta")
//@CrossOrigin
@Api(value = "统计模块")
public class StatisticsDailyController {

    @Resource
    private IStatisticsDailyService statisticsDailyService;


    @ApiOperation("统计一天的注册人数")
    @GetMapping("registerCount/{day}")
    public R registerCount(@PathVariable String day) {

        R r = statisticsDailyService.registerCount(day);
        return r;
    }


    @ApiOperation(value = "图表显示")
    @GetMapping("showData/{type}/{begin}/{end}")
    public R showData(@PathVariable String type,
                      @PathVariable String begin,
                      @PathVariable String end) {

        Map<String,Object> map= statisticsDailyService.getShowData(type, begin, end);
        return R.ok().data(map);

    }

}

